home *** CD-ROM | disk | FTP | other *** search
Wrap
head 1.6; branch ; access ; symbols beta10:1.5; locks death:1.6; strict; comment @ * @; 1.6 date 93.04.04.23.44.23; author death; state Exp; branches ; next 1.5; 1.5 date 93.01.10.15.07.53; author death; state Exp; branches ; next 1.4; 1.4 date 92.07.26.13.57.52; author death; state Exp; branches ; next 1.3; 1.3 date 92.04.27.20.40.19; author death; state Exp; branches ; next 1.2; 1.2 date 92.04.05.22.51.05; author death; state Exp; branches ; next 1.1; 1.1 date 92.03.29.12.18.23; author death; state Exp; branches ; next ; desc @This is an early draft of a File object. @ 1.6 log @Sun Apr 4 23:44:23 PDT 1993 @ text @/* ==================================================================== This is the interface file for the File class. Full documentation for this class can be found in the File.rtf file. I will not duplicate all that fine information here. This is $Revision: 1.5 $ of this file It was last modified by $Author: death $ on $Date: 93/01/10 15:07:53 $ Note that this file was created while using the New Century Schoolbook Roman typeface. You may find that some things line up strangely if you don't use that family. *$Log: File.h,v $ * Revision 1.5 93/01/10 15:07:53 death * Sun Jan 10 15:07:52 PST 1993 * * Revision 1.4 92/07/26 13:57:52 death * Update so all works with the font converter... * * Revision 1.2 92/04/05 22:51:05 death * Miscelaneous revisions. This is the last version of version 1. * * Revision 1.1 92/03/29 12:18:23 death * Initial revision * *==================================================================== */ // // Import our parent class' definition // #import "ResultObject.h" #import "common.h" // // For stat info... // #include <sys/types.h> #include <sys/stat.h> // // Define types for positions in the underlying file. // typedef PositiveInteger FilePos; typedef FilePos FilePosDelta; typedef Integer AccessType; // // #define fileAtEOF 1 #define fileAtStart 2 #define fileInMiddle 3 // // Now, define our interface. Again, see the File.rtf document for general info. // @@interface File:ResultObject { CString FileName; AccessType AccessMode; NXStream* TheFile; ino_t TheInode; Integer FileLocation; Boolean FileIsOpen; } - initAndUse:(roCString) pathname; - initAndUseTemporary; - CreateAndOpenFor: (AccessType) access; - OpenExistingFor: (AccessType) access; - ClearAndOpenExistingFor: (AccessType) access; - ClearAndOpenFor: (AccessType) access; - OpenFor: (AccessType) access; - OpenWithAccess: (Integer) operation; // - CloseAndDelete; - Close; - CloseAndSave; - free; // - AdvanceBytes: (FilePosDelta) byteLoc; - BackupBytes: (FilePosDelta) byteLoc; - (CString) GetBasename; - (FilePos) GetCurrentPosition; - (CString) GetExtension; - (CString) GetFilename; - (CString) GetPathname; - (CString) GetDirectory; - MoveTo: (PositiveInteger) byteLoc; - (Byte) ReadByte; - Read: (PositiveInteger) numBytes BytesInto: (ByteString) buffer; - WriteByte: (Byte) theByte; - Write: (PositiveInteger) numBytes BytesFrom: (ByteString) buffer; - (PositiveInteger) FileSize; - FileInfo; - (Boolean) SameFileAs: (CString) someOtherFile; // // internal methods // - (CString) GetFullPathFrom: (roCString) pathname; - ClearFile: (CString) pathname; - CreateFile: (CString) pathname; - (Boolean) FileExists: (CString) pathname; @@end // // Now, define some constants used by the class to define the kinds of errors that may occurr // #define FILE_READ 0 #define FILE_WRITE 1 #define FILE_READWRITE 2 #define FILE_APPEND 3 #define FILE_NOACCESS -1 // // Error codes (using 100 to -300) // #define ERR_STRANGEPATH 50 #define ERR_BADACCESS -100 #define ERR_FILENOTOPEN -120 #define ERR_CANTOPEN -105 #define ERR_CANTDELETE -106 #define ERR_FILEREADONLY -150 #define ERR_FILEWRITEONLY -151 #define ERR_FILEAPPENDONLY -152 #define ERR_NOSUCHFILE -160 #define ERR_CREATEFAIL -170 #define ERR_FILEEXISTS -171 #define ERR_SOMEFILEOPEN -172 #define ERR_FILEDOESNTEXIST -173 #define ERR_CLEARFAIL -174 #define ERR_WRITINGERROR -200 #define ERR_FLUSHINGERROR -201 #define ERR_WROTEBADCHAR -202 #define ERR_READINGERROR -205 #define ERR_BADBACKUP -220 #define ERR_BADADVANCE -221 #define ERR_NODIRECTORY -250 #define ERR_CANTGETINFO -275 #define ERR_EOF -225 @ 1.5 log @Sun Jan 10 15:07:52 PST 1993 @ text @d4 2 a5 2 This is $Revision: 1.4 $ of this file It was last modified by $Author: death $ on $Date: 92/07/26 13:57:52 $ d8 3 @ 1.4 log @Update so all works with the font converter... @ text @d4 2 a5 2 This is $Revision: 1.2 $ of this file It was last modified by $Author: death $ on $Date: 92/04/05 22:51:05 $ d8 3 d134 1 @ 1.3 log @misc changes.. (intermediate version) @ text @d20 7 a26 2 #import <objc/Object.h> #import "generalTypes.h" d31 3 d35 5 a39 2 typedef unsigned long int FilePos; typedef FilePos FilePosDelta; a40 1 d44 1 a44 2 @@interface File:Object d46 6 a51 3 Cstring fileName; long int accessType; NXStream* theFile; d54 23 a76 14 - (id) openFile: (const char *) filename For: (long int) operation; - (id) openFile: (const char *) filename; - (id) initFile: (const char *) workingName For: (long int) operation; - (id) close; - (id) closeFile; - (id) advanceBytes: (FilePosDelta) byteLoc; - (id) backupBytes: (FilePosDelta) byteLoc; - (Cstring) getBasename; - (FilePos) getCurrentPosition; - (Cstring) getExtension; - (Cstring) getFilename; - (Cstring) getPathname; - (Cstring) getDirectory; - (id) MoveTo: (PositiveInteger) byteLoc; d78 13 a90 4 - (id) Read: (PositiveInteger) numBytes BytesInto: (ByteString) buffer; - (id) WriteByte: (Byte) theByte; - (id) Write: (PositiveInteger) numBytes BytesFrom: (ByteString) buffer; - (id) FileSize; d94 2 d100 1 d105 1 a105 3 d107 1 a107 1 // Error codes d109 2 d112 19 a130 4 #define ERR_CANTOPEN -105 #define ERR_BADACCESS -100 #define ERR_PEACHY 0 #define ERR_GROOVY 0 @ 1.2 log @Miscelaneous revisions. This is the last version of version 1. @ text @d4 2 a5 2 This is $Revision: 1.1 $ of this file It was last modified by $Author: death $ on $Date: 92/03/29 12:18:23 $ d8 3 d55 6 a60 6 - (id) moveTo: (FilePos) byteLoc; - (id) readByte; - (id) read: (long int) numBytes bytesInto: (byte*) buffer retrieving: (long int*) bytesFound; - (id) writeByte: (byte) theByte; - (id) write: (long int) numBytes bytesFrom: (byte*) buffer writing: (long int*) bytesWrote; - (id) fileSize; @ 1.1 log @Initial revision @ text @d4 2 a5 2 This is $Revision:$ of this file It was last modified by $Author:$ on $Date:$ d7 4 a10 1 *$Log:$ d39 4 a42 2 - (id) openFile: (Cstring) filename For: (long int) operation; - (id) openFile: (Cstring) filename; d51 1 @